package dao

import javax.inject.Inject

import models.Tables._
import play.api.db.slick.{DatabaseConfigProvider, HasDatabaseConfigProvider}
import slick.jdbc.JdbcProfile

import scala.concurrent.Future

import scala.concurrent.ExecutionContext.Implicits.global

class couponDao  @Inject()(protected val dbConfigProvider: DatabaseConfigProvider) extends
  HasDatabaseConfigProvider[JdbcProfile]{

  import profile.api._


  def addCoupon(row: Seq[CouponRow]) : Future[Unit] = {
    db.run(Coupon ++= row).map(_=>())
  }

  def getAll : Future[Seq[CouponRow]] = {
    db.run(Coupon.result)
  }

}
